﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (Session["username"] == null)
        {
            //如果用户未登陆
            Response.Redirect("Login.aspx");
        }
        else//如果登陆
        {
            LabelUserName.Text = Session["username"].ToString();//显示用户名
        }
    }
}
